﻿using BonjourQuotation.DataAccess.Repositories;
using BonjourQuotation.ObjectModel.AccountData;
using BonjourQuotation.ObjectModel.ErrorData;
using BonjourQuotation.ObjectModel.BusinessData;
using BonjourQuotation.ObjectModel.LoggerData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BonjourQuotation.UI.ServiceManagers
{
    public class BaseManager
    {
        private readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        public UserAllPermissionsBData GetPermssions(string UserName)
        {
            try
            {
                var proxy = new BaseRepository();
                return proxy.GetPermssions(UserName);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            } 
        }
        public List<string> GetUserRegions(string UserName)
        {
            try
            {
                var proxy = new BaseRepository();
                return proxy.GetUserRegions(UserName);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
    }
}